package com.example.review.utils.skillUtils;

import android.util.Log;

/**
 * 日志打印工具类
 * 能够自由地控制日志的打印，当程序处于开发阶段时就让日志打印出来，当程序上线了之 后就把日志屏蔽掉
 *
 *
 * 你只需要在开发阶段将level 指定 成VERBOSE ，所有级别的日志都可以打印出来；当项目正式上线的时候将level 指定成NOTHING 就可以了
 */
public class LogUtils {

    public static final int VERBOSE = 1;
    public static final int DEBUG = 2;
    public static final int INFO = 3;
    public static final int WARN = 4;
    public static final int ERROR = 5;
    public static final int NOTHING = 6;
    public static int level = VERBOSE;

    public static void v(String tag, String msg) {
        if (level <= VERBOSE) {
            Log.v(tag, msg);
        }
    }
    public static void d(String tag, String msg) {
        if (level <= DEBUG) {
            Log.d(tag, msg);
        }
    }
    public static void i(String tag, String msg) {
        if (level <= INFO) {
            Log.i(tag, msg);
        }
    }
    public static void w(String tag, String msg) {
        if (level <= WARN) {
            Log.w(tag, msg);
        }
    }
    public static void e(String tag, String msg) {
        if (level <= ERROR) {
            Log.e(tag, msg);
        }
    }
}
